To allow the sequence grabber to work with your panel's settings, your panel component must allow the sequence grabber to
Listing 7-3 gives an example in which the settings are managed in a user list that contains tick count information for a panel component for PICT images.
Listing 3 Managing the settings for a panel component
pascal ComponentResult PictPanelPanelGetSettings
(PictPanelGlobals store, SGChannel c,
UserData *result, long flags)
{
OSErr err;
UserData ud;
Boolean ticksShowing;
/* create a user data list containing your state */
if (err = NewUserData (&ud)) goto bail;
if (err = SGGetShowTickCount (c, &ticksShowing)) goto bail;
if (err = SetUserDataItem (ud, &ticksShowing,
sizeof (ticksShowing),
sgcPictShowTicksType, 1)) goto bail;
bail:
if (err) {
DisposeUserData(ud);
ud = 0;
}
*result = ud;
return err;
}
pascal ComponentResult PictPanelPanelSetSettings
(PictPanelGlobals store, SGChannel c,
UserData ud, long flags)
{
Boolean ticksShowing;
/* restore the state from the specified user data list */
if (GetUserDataItem (ud, &ticksShowing,
sizeof (ticksShowing),
sgcPictShowTicksType, 1) == noErr)
SGSetShowTickCount (c, ticksShowing);
return noErr;
}